<%#
# To change this template, choose Tools | Templates
# and open the template in the editor.
%>

<h2>Calendars</h2>
<p style="color:red"><%=@error%></p>

<table>
  <tr>
  
    <th width="300">Title</th>
 
  </tr>

<% @calendars.each do |calendar| %>
  <%# cal_id_temp=calendar.url.sub!("/calendar/feeds/", '')%>
  <%# cal_id=cal_id_temp.sub!("/private/full",'') %>


  <tr>
    <td><%=h calendar["cal_title"] %></td>
    <%#*<td>%>
    <%#= link_to 'Show',"calendars/show/" %>
    <%#*</td>%>
    <td><%= link_to 'Edit', "calendars/update/#{calendar["cal_title"]}?cal_id=#{calendar["cal_id"]}" %></td>
    <td><%= link_to 'Destroy', "calendars/destroy/?title="+calendar["cal_title"]+"&cal_id="+calendar["cal_id"], :confirm => 'Are you sure?', :method => :destroy %></td>
    <td><%= link_to 'Events', "events?title="+calendar["cal_title"]+"&cal_id="+calendar["cal_id"] %></td>
  </tr>
<% end if not @calendars.nil? %>
</table>

<br />

<%= link_to 'New Calendar', "calendars/new/" %>
&nbsp;&nbsp;

<%= link_to 'Refresh List', "calendars/refresh/" ,:confirm => 'Are you sure? This will take some time to complete.' %>
